#ifndef _ZERO_INCLUDE_CONFIG_H
#define _ZERO_INCLUDE_CONFIG_H
#define interface class
#define INTERFACE class

#define FIX_ELF_INITIAL_ADDRESS	0x10000
#define PIC_ELF_INITIAL_ADDRESS	0x20000

struct kernel_symbol
{
	unsigned long value;
	const char *name;
};

#define KERNEL_SYMBOL(value) \
	static const char __os_strtab_##value[] \
	__attribute__((section("os_symtab_strings"), aligned(1))) \
	= "" #value; \
	static const struct kernel_symbol __os_symtab_##value \
	__attribute__((section("os_symtab"), used)) \
	= { (unsigned long) &value, __os_strtab_##value }

#define EXPORT_CLASS_TYPEINFO(v, i) \
	extern "C" char v; \
	KERNEL_SYMBOL(v); \
	extern "C" char i; \
	KERNEL_SYMBOL(i);

#define EXPORT_CXX_TEXT(text) \
	extern "C" char text; \
	KERNEL_SYMBOL(text);

#define EXPORT_CXX_DATA(data) \
	extern "C" char data; \
	KERNEL_SYMBOL(data);

#define EXPORT_C_TEXT(text) \
	KERNEL_SYMBOL(text);

#define SMP
#ifdef SMP
#define LOCK_PREFIX "lock;"
#else
#define LOCK_PREFIX ""
#endif

#define DEBUG
#define BUG

#define INITTEXT __attribute__((section(".inittext"), nothrow))
#define INITDATA __attribute__((section(".initdata")))

#define NULL 0
typedef unsigned __attribute__((mode(pointer))) ptr_t;
typedef int ptrdiff_t;
typedef unsigned long laddr_t;
#define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
#define containerof(ptr, TYPE, MEMBER) ((TYPE*) (reinterpret_cast<ptr_t>(ptr) - offsetof(TYPE, MEMBER)))
typedef __builtin_va_list va_list;
#define va_start(ap, fmt) __builtin_va_start(ap, fmt)
#define va_arg(ap, l) __builtin_va_arg(ap, l)
#define va_end(ap) __builtin_va_end(ap)

#endif
